package cn.tedu.tmall.admin.content.service.impl;

import cn.tedu.tmall.admin.content.dao.persist.repository.ICategoryRepository;
import cn.tedu.tmall.admin.content.pojo.entity.Category;
import cn.tedu.tmall.admin.content.pojo.parm.CategoryAddNewParm;
import cn.tedu.tmall.admin.content.service.ICategoryService;


import cn.tedu.tmall.admin.content.service.ICategoryService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class CategoryServiceImpl implements ICategoryService {

    @Autowired
    ICategoryRepository categoryRepository;

    @Override
    public void addNew(CategoryAddNewParm categoryAddNewParm){
        Category category = new Category();
        BeanUtils.copyProperties(categoryAddNewParm,category);

        categoryRepository.insert(category);
    }
}
